package com.legoo.studaychineseonline.fragment;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;
import android.widget.ImageView;
import android.widget.LinearLayout;
import android.widget.TextView;

import com.legoo.studaychineseonline.R;
import com.legoo.studaychineseonline.activity.AboutMeActivity;
import com.legoo.studaychineseonline.activity.CollectionActivity;
import com.legoo.studaychineseonline.activity.InvitationCodeActivity;
import com.legoo.studaychineseonline.activity.LoginActivity;
import com.legoo.studaychineseonline.activity.MyActivityActivity;
import com.legoo.studaychineseonline.activity.OpinionActivity;
import com.legoo.studaychineseonline.activity.RechargeRecordActivity;
import com.legoo.studaychineseonline.activity.SetActivity;
import com.legoo.studaychineseonline.activity.UserInfoActivity;
import com.legoo.studaychineseonline.activity.YiGouKeChengActivity;
import com.legoo.studaychineseonline.base.BaseFragment;
import com.legoo.studaychineseonline.utils.ImageUtil;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;
import butterknife.Unbinder;

public class MyFragment extends BaseFragment {
    @BindView(R.id.tv_title_left)
    TextView tvTitleLeft;
    @BindView(R.id.tv_title)
    TextView tvTitle;
    @BindView(R.id.tv_title_right)
    TextView tvTitleRight;
    @BindView(R.id.iv_pic)
    ImageView ivPic;
    @BindView(R.id.tv_name)
    TextView tvName;
    @BindView(R.id.ll_tou)
    LinearLayout llTou;
    @BindView(R.id.tv_money)
    TextView tvMoney;
    @BindView(R.id.bt_recharge)
    Button btRecharge;
    @BindView(R.id.ll_yigou)
    LinearLayout llYigou;
    @BindView(R.id.ll_shoucang)
    LinearLayout llShoucang;
    @BindView(R.id.ll_huodong)
    LinearLayout llHuodong;
    @BindView(R.id.ll_chongzhi)
    LinearLayout llChongzhi;
    @BindView(R.id.ll_jianyi)
    LinearLayout llJianyi;
    @BindView(R.id.ll_xitong)
    LinearLayout llXitong;
    @BindView(R.id.ll_yaoqing)
    LinearLayout llYaoqing;
    @BindView(R.id.ll_guanyu)
    LinearLayout llGuanyu;
    Unbinder unbinder;

    @Override
    protected void initView(View view, Bundle savedInstanceState) {
        unbinder = ButterKnife.bind(this, view);
        tvTitleLeft.setVisibility(View.INVISIBLE);
        tvTitleRight.setVisibility(View.INVISIBLE);
        tvTitle.setText("我的");

    }

    @Override
    protected int getLayoutId() {
        return R.layout.fragment_my;
    }



    @Override
    public void onDestroyView() {
        super.onDestroyView();
        unbinder.unbind();
    }

    @OnClick({R.id.ll_tou, R.id.bt_recharge, R.id.ll_yigou, R.id.ll_shoucang, R.id.ll_huodong, R.id.ll_chongzhi, R.id.ll_jianyi, R.id.ll_xitong, R.id.ll_yaoqing, R.id.ll_guanyu})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.ll_tou:
                startIntent(UserInfoActivity.class);
                break;
            case R.id.bt_recharge:
                startIntent(LoginActivity.class);
                break;
            case R.id.ll_yigou:
                startIntent(YiGouKeChengActivity.class);
                break;
            case R.id.ll_shoucang:
                startIntent(CollectionActivity.class);
                break;
            case R.id.ll_huodong:
                startIntent(MyActivityActivity.class);
                break;
            case R.id.ll_chongzhi:
                startIntent(RechargeRecordActivity.class);
                break;
            case R.id.ll_jianyi:
                startIntent(OpinionActivity.class);
                break;
            case R.id.ll_xitong:
                startIntent(SetActivity.class);
                break;
            case R.id.ll_yaoqing:
                startIntent(InvitationCodeActivity.class);
                break;
            case R.id.ll_guanyu:
                startIntent(AboutMeActivity.class);
                break;
                default:
                    break;
        }
    }
}
